#ifndef SALESMANCANVAS_H_
#define SALESMANCANVAS_H_

#include <QWidget>
#include <QPixmap>
#include <QPainter>
#include <QMouseEvent>

//#include <QMetaType>

#include "SalesmanData.h"

class SalesmanCanvas : public QWidget
{
    Q_OBJECT
public:
    SalesmanCanvas(QWidget* parent = 0);
    ~SalesmanCanvas();

    SalesmanData getData();

signals:

public slots:
    void clear();
    void setCityPath(QList<int> _cityPath);
    void setCityPath(QVariant _cityPath);
    void setData(SalesmanData data);

protected:
    void paintEvent ( QPaintEvent *event );
    void mousePressEvent ( QMouseEvent *event );


private:
    void drawPixmap();
    /**
     * Pixmap to redraw current view. It is needed to avoid flickering.
     */
    QPixmap pixmap;

    SalesmanData salesmanData;
    QList<int> cityPath;
};

#endif /*SALESMANCANVAS_H_*/
